<?php
ini_set('error_reporting', 'E_ALL & ~E_DEPRECATED');
require_once 'simpletest/unit_tester.php';
require_once 'simpletest/reporter.php';
require_once dirname(__FILE__) . '/../Mcrypt.php';

class McrypTest extends UnitTestCase
{
	public function test1100()
	{
		$obj = new Mcrypt('good');
		$src = $obj->enc('fire');
		$RET = $obj->dec($src);
		$this->assertEqual($RET, 'fire');
	}

	public function test1200()
	{
		$obj = new Mcrypt('good');
		$src = $obj->enc('great123');
		$iv = $obj->getIv();
		$obj2 = new Mcrypt('good');
		$RET = $obj2->dec($src);
		$this->assertEqual($RET, 'great123');
	}
}
